using NL;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;

namespace XGame
{
    public static class ObjectEX
    {
        public static NLIni ASIni(this object target)
        {
            if (target == null) return new NLIni();

            FieldInfo[] _fields = target.GetType().GetFields();
            if (_fields == null) return new NLIni();
            NLIni _info = new NLIni();

            foreach (var f in _fields)
            {
                _info[f.Name] = f.GetValue(target).ToString();
            }


            return _info;
        }
    }

}
